<#assign prefixName = 'WHERE'>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
<#if (where_and_eq_id??)>
	<#if (where_and_eq_id_value??)>
${prefixName} T.ID = :where_and_eq_id_value
	<#else>
${prefixName} T.ID IS NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_and_nq_id??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
	<#if (where_and_nq_id_value??)>
${prefixName} T.ID <> :where_and_nq_id_value
	<#else>
${prefixName} T.ID IS NOT NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_and_like_id??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
	<#if (where_and_like_id_value??)>
${prefixName} T.ID <> :where_and_like_id_value
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_eq_id??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_eq_id_value??)>
${prefixName} T.ID = :where_or_eq_id_value
	<#else>
${prefixName} T.ID IS NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_nq_id??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_nq_id_value??)>
${prefixName} T.ID <> :where_or_nq_id_value
	<#else>
${prefixName} T.ID IS NOT NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_like_id??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_like_id_value??)>
${prefixName} T.ID like :where_or_like_id_value
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
<#if (where_and_eq_orgId??)>
	<#if (where_and_eq_orgId_value??)>
${prefixName} T.ORG_ID = :where_and_eq_orgId_value
	<#else>
${prefixName} T.ORG_ID IS NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_and_nq_orgId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
	<#if (where_and_nq_orgId_value??)>
${prefixName} T.ORG_ID <> :where_and_nq_orgId_value
	<#else>
${prefixName} T.ORG_ID IS NOT NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_and_like_orgId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
	<#if (where_and_like_orgId_value??)>
${prefixName} T.ORG_ID <> :where_and_like_orgId_value
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_eq_orgId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_eq_orgId_value??)>
${prefixName} T.ORG_ID = :where_or_eq_orgId_value
	<#else>
${prefixName} T.ORG_ID IS NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_nq_orgId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_nq_orgId_value??)>
${prefixName} T.ORG_ID <> :where_or_nq_orgId_value
	<#else>
${prefixName} T.ORG_ID IS NOT NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_like_orgId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_like_orgId_value??)>
${prefixName} T.ORG_ID like :where_or_like_orgId_value
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
<#if (where_and_eq_permissionId??)>
	<#if (where_and_eq_permissionId_value??)>
${prefixName} T.PERMISSION_ID = :where_and_eq_permissionId_value
	<#else>
${prefixName} T.PERMISSION_ID IS NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_and_nq_permissionId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
	<#if (where_and_nq_permissionId_value??)>
${prefixName} T.PERMISSION_ID <> :where_and_nq_permissionId_value
	<#else>
${prefixName} T.PERMISSION_ID IS NOT NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_and_like_permissionId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName='AND'>
</#if>
	<#if (where_and_like_permissionId_value??)>
${prefixName} T.PERMISSION_ID <> :where_and_like_permissionId_value
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_eq_permissionId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_eq_permissionId_value??)>
${prefixName} T.PERMISSION_ID = :where_or_eq_permissionId_value
	<#else>
${prefixName} T.PERMISSION_ID IS NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_nq_permissionId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_nq_permissionId_value??)>
${prefixName} T.PERMISSION_ID <> :where_or_nq_permissionId_value
	<#else>
${prefixName} T.PERMISSION_ID IS NOT NULL
	</#if>
	<#assign prefixName = ''>
</#if>
<#if (where_or_like_permissionId??)>
<#if (prefixName!) != 'WHERE'>
	<#assign prefixName = 'OR'>
</#if>
	<#if (where_or_like_permissionId_value??)>
${prefixName} T.PERMISSION_ID like :where_or_like_permissionId_value
	</#if>
	<#assign prefixName = ''>
</#if>
